# This file is a shell script fragment that supplies the information
# necessary for a configure script to process the program in
# this directory.  For more information, look at ../configure.

configdirs="tests dbz stdio"
srctrigger=libioP.h
srcname="input/output library"
package_makefile_frag=Make.pack

# per-host:

# per-target:

echo "# Warning: this fragment is automatically generated" > temp.mt
frags=

case "${target}" in
  *-*-hpux*)       frags=hpux ;;
  *-*-linux*)      frags=linux ;;
  *-*-sco3.2v4*)   frags=sco4 ;;
  *-*-isc*)        frags=isc ;;
  *-*-netware*)    frags=netware ;;
  *-*-*)           frags=${target_cpu}
esac

if [ "${enable_shared}" = "yes" ]; then
  case "${target}" in
    hppa*-*-*)	   frags="${frags} mt-papic" ;;
    i[345]86-*-*)  frags="${frags} mt-x86pic" ;;
    *-*-*)	   frags="${frags} mt-${target_cpu}pic" ;;
  esac
fi

for frag in ${frags}; do
  frag=${srcdir}/config/$frag
  if [ -f ${frag} ]; then
    echo "Appending ${frag} to target-mkfrag"
    echo "# Following fragment copied from ${frag}" >> temp.mt
    cat ${frag} >> temp.mt
  fi
done

target_makefile_frag=target-mkfrag
${moveifchange} temp.mt target-mkfrag

LIBDIR=yes
TO_TOPDIR=../
ALL='$(_G_CONFIG_H) libio.a libiostream.a $(OSPRIM_OBJECTS)'
CINCLUDES='-I. -I$(srcdir)'
CXXINCLUDES='-I. -I$(srcdir)'
MOSTLYCLEAN='*.o core iostream.list'
CLEAN='_G_config.h *.a'
INFO_FILES=iostream
(. ${srcdir}/config.shared) >${package_makefile_frag}

# post-target:

# If cross-compiling, don't build gperf or the utils.  They
# will get built by the target compiler, which is confusing.
# We cannot test the installation.  We install in $(tooldir).
if [ ${host} != ${target} ] ; then
    rm -f Makefile.tem
    sed \
	-e 's|INSTALLDIR.*=.*$|INSTALLDIR = $(tooldir)/lib|' \
	Makefile >Makefile.tem
    mv -f Makefile.tem Makefile
fi

